package itheima.d12;

import org.w3c.dom.ls.LSOutput;

import java.util.Scanner;

public class Teest1 {
    public static void main(String[] args) {
//        String data="a";
//        if (data.matches("[^abc]")){
//            System.out.println("匹配");
//        }else {
//            System.out.println("不匹配");
//        }


        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String username = sc.next();
        if (username.matches("[a-zA-Z0-9_]{6,20}")){
            System.out.println("用户名格式正确");
        }else
            System.out.println("用户名格式错误");
        System.out.println("请输入密码：");
        String password = sc.next();
        if (password.matches("[A-Z][a-zA-Z0-9_$]{7,}")){
            System.out.println("密码格式正确");
        }else
            System.out.println("密码格式错误");
    }




}
